/**
 */
package gatperdut.chato.model.Chato.Item.impl;

import gatperdut.chato.model.Chato.Constant.WearLoc;

import gatperdut.chato.model.Chato.Item.EntityInventorySlot;
import gatperdut.chato.model.Chato.Item.Item;
import gatperdut.chato.model.Chato.Item.ItemPackage;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.internal.cdo.CDOObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Entity Inventory Slot</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link gatperdut.chato.model.Chato.Item.impl.EntityInventorySlotImpl#getWearLoc <em>Wear Loc</em>}</li>
 *   <li>{@link gatperdut.chato.model.Chato.Item.impl.EntityInventorySlotImpl#getItem <em>Item</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class EntityInventorySlotImpl extends CDOObjectImpl implements EntityInventorySlot {
	/**
     * The default value of the '{@link #getWearLoc() <em>Wear Loc</em>}' attribute.
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @see #getWearLoc()
     * @generated
     * @ordered
     */
	protected static final WearLoc WEAR_LOC_EDEFAULT = WearLoc.LHAND;

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	protected EntityInventorySlotImpl() {
        super();
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	protected EClass eStaticClass() {
        return ItemPackage.Literals.ENTITY_INVENTORY_SLOT;
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	protected int eStaticFeatureCount() {
        return 0;
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public WearLoc getWearLoc() {
        return (WearLoc)eDynamicGet(ItemPackage.ENTITY_INVENTORY_SLOT__WEAR_LOC, ItemPackage.Literals.ENTITY_INVENTORY_SLOT__WEAR_LOC, true, true);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public void setWearLoc(WearLoc newWearLoc) {
        eDynamicSet(ItemPackage.ENTITY_INVENTORY_SLOT__WEAR_LOC, ItemPackage.Literals.ENTITY_INVENTORY_SLOT__WEAR_LOC, newWearLoc);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public Item getItem() {
        return (Item)eDynamicGet(ItemPackage.ENTITY_INVENTORY_SLOT__ITEM, ItemPackage.Literals.ENTITY_INVENTORY_SLOT__ITEM, true, true);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public Item basicGetItem() {
        return (Item)eDynamicGet(ItemPackage.ENTITY_INVENTORY_SLOT__ITEM, ItemPackage.Literals.ENTITY_INVENTORY_SLOT__ITEM, false, true);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	public void setItem(Item newItem) {
        eDynamicSet(ItemPackage.ENTITY_INVENTORY_SLOT__ITEM, ItemPackage.Literals.ENTITY_INVENTORY_SLOT__ITEM, newItem);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
        switch (featureID) {
            case ItemPackage.ENTITY_INVENTORY_SLOT__WEAR_LOC:
                return getWearLoc();
            case ItemPackage.ENTITY_INVENTORY_SLOT__ITEM:
                if (resolve) return getItem();
                return basicGetItem();
        }
        return super.eGet(featureID, resolve, coreType);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public void eSet(int featureID, Object newValue) {
        switch (featureID) {
            case ItemPackage.ENTITY_INVENTORY_SLOT__WEAR_LOC:
                setWearLoc((WearLoc)newValue);
                return;
            case ItemPackage.ENTITY_INVENTORY_SLOT__ITEM:
                setItem((Item)newValue);
                return;
        }
        super.eSet(featureID, newValue);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public void eUnset(int featureID) {
        switch (featureID) {
            case ItemPackage.ENTITY_INVENTORY_SLOT__WEAR_LOC:
                setWearLoc(WEAR_LOC_EDEFAULT);
                return;
            case ItemPackage.ENTITY_INVENTORY_SLOT__ITEM:
                setItem((Item)null);
                return;
        }
        super.eUnset(featureID);
    }

	/**
     * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
     * @generated
     */
	@Override
	public boolean eIsSet(int featureID) {
        switch (featureID) {
            case ItemPackage.ENTITY_INVENTORY_SLOT__WEAR_LOC:
                return getWearLoc() != WEAR_LOC_EDEFAULT;
            case ItemPackage.ENTITY_INVENTORY_SLOT__ITEM:
                return basicGetItem() != null;
        }
        return super.eIsSet(featureID);
    }

} //EntityInventorySlotImpl
